package com.github.ghsea.sso.client.security.cas;

import java.io.Serializable;

/**
 * @author guhai
 */
public class UserPrincipal implements Serializable {

    /**
     * 编号
     */
    private String id;

    /**
     * 登录名
     */
    private String loginName;

    /**
     * 姓名
     */
    private String name;
    private String mail;


    public String getLoginName() {
        return loginName;
    }

    public UserPrincipal setLoginName(String loginName) {
        this.loginName = loginName;
        return this;
    }

    public String getId() {
        return id;
    }

    public String getMail() {
        return mail;
    }

    public UserPrincipal setMail(String mail) {
        this.mail = mail;
        return this;
    }

    public UserPrincipal setId(String id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public UserPrincipal setName(String name) {
        this.name = name;
        return this;
    }

    /**
     * 获取SESSIONID
     */
    public String getSessionid() {
        try {
            return (String) UserInfoUtils.getSession().getId();
        } catch (Exception e) {
            return "";
        }
    }
}
